﻿@model PagedResult<token_bazaar_order_dto>
@{
    var img_url = ViewBag.img_url;
    if (Model.rows.Count > 0) {
        foreach (var item in Model.rows) {
            <li >
                <div class="content" onclick="javascript:location.href='/BazaarOrder/OrderDetail?id=@item.id'">
                    <div class="img">
                        <img src="@(img_url + item.product_img)" />
                    </div>
                    <div class="text">
                        <p class="mb20 fn-pfBold">
                            <a class="fn28" href="">
                               @item.product_name
                            </a>
                        </p>
                        <div class="price fn24 col-gray">
                            <span class="col-red fn30 fn-pfBold">@item.price.ToString("f6")</span> 红钻
                            @{ string status_style = "red";
                                if (item.status == EBazaarOrderStatus.Cancle || item.status == EBazaarOrderStatus.Finish) { status_style = "grays"; } else if (item.status == EBazaarOrderStatus.Delivery) { status_style = "green"; } else { status_style = "red"; }
                            }

                            <span class="fn28 release-state @status_style">@item.status_desc</span>
                        </div>
                    </div>
                </div>
                <div class="btnBox">
                    <a href="tel:@item.buy_merchant_mobile" class="contact"><i class="icon-contact"></i>联系买家</a>
                    @if (item.status == EBazaarOrderStatus.Cancle || item.status == EBazaarOrderStatus.Finish) {
                        <button class="ui-btn  ui-btn-share ui-btn-defaults ui-btn-180 btn_del" type="button" data-id="@item.id">删除</button>
                    } else if (item.status == EBazaarOrderStatus.Received) {
                        <button class="ui-btn  ui-btn-share  ui-btn-180 " type="button"  onclick="javascript:location.href='/BazaarOrder/OrderShip?id=@item.id'">发货</button>
                        <button class="ui-btn  ui-btn-share ui-btn-defaults ui-btn-180 btn_cancle" type="button" data-id="@item.id">取消</button>

                    } else if (item.status == EBazaarOrderStatus.Delivery) {
                        <button class="ui-btn  ui-btn-share ui-btn-defaults ui-btn-180" type="button" style="border:0px;"></button>
                    }

                </div>
            </li>
        }
    }
    <page rows="@Model.rows.Count()" total_result="@Model.total_result"></page>
}





